You can change a group's sort direction through the SortDirection property of the Area Object. To change a group's sort direction you can use code similar to the following:
Note: All the samples are based on the sample database, XTREME.MDB, which is installed by Crystal Reports.
Dim CRXReport As New CrystalReport1
Private Sub Form_Load()The Item parameter "GH1" refers to the first group header; to access the second group header you would use "GH2" This line of code sets the SortDirection to descending.
CRXReport.Areas.Item("GH1").SortDirection = crDescendingOrder
CRViewer1.ReportSource = CRXReport CRViewer1.ViewReport End Sub
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |